<?php
/*
 *   This file is part of verbum.
 *
 *   poat is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   poat is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with poat.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * 	 Copyright (c) 2008 Sergio Gabriel Teves <gabriel.sgt at gmail.com>
 */

//$team = new team;
//$team->status=STATUS_ACTIVE;
//$list = $loader->loadListBy($team,$team->listByStatus());

/*
      },{
        xtype:"combo",
        fieldLabel:"<?php echo s/("Prefered Date Presentation"); ?>",
        hiddenName: "dateformat", 
        allowBlank: true,
        emptyText: "<?php echo s/("Select one from the list or enter your own."); ?>",
        forceSelection: false,
        store: <?php echo $dlist ?>,
        triggerAction: 'all',
        listWidth: 150,
        id: "userDateFormat"
      },{
    	xtype : "label",
    	text : "<?php echo s/("To check for available formats see http://www.php.net/date")?>"
*/
$team = new team;
$team->id=getTeamId($CURRENT_USER);
$loader->get($team);

$tzonelist = jsonArray($TIMEZONE_LIST,"value","name"); 
$llist = jsonArray(loadLanguageList(),"lang","name");		
//$llist = jsonArray($LANGUAGE_LIST,"value","name");
//$tlist = jsonArray($list,"id","name");
$dlist = jsonArray($DATE_FORMAT,"value","value");

?>
{   xtype:"fieldset",
    autoHeight:true,
    labelWidth:190,
    items:[{
        xtype:"textfield",
        fieldLabel:"<?php echo s("Real name",null,true); ?>",
        name:"name",
		width:150,
        allowBlank:false,
        value:"<?php echo $CURRENT_USER->name; ?>",
        maxLength: 50
      },{
        xtype:"textfield",
        fieldLabel:"<?php echo s("e-mail",null,true); ?>",
        name:"email",
		width:150,
        allowBlank:false,
        blankText:"<?php echo s("Please, enter a valid e-mail address.",null,true); ?>",
        vtype:"email",
        value:"<?php echo $CURRENT_USER->mail; ?>",
      },{
        xtype:"textfield",
        fieldLabel:"<?php echo s("Team",null,true); ?>",
        value:"<?php echo $team->name; ?>",
        disabled: true,
      },{
        xtype:"textfield",
        fieldLabel:"<?php echo s("Profile",null,true); ?>",
        value:"<?php echo $DEF_TRANS[$CURRENT_USER->groupid]; ?>",
        disabled: true,
      },{
        xtype:"combo",
        fieldLabel:"<?php echo s("Language",null,true); ?>",
        hiddenName:"langid",
        value:"<?php echo $CURRENT_USER->lang; ?>",
        allowBlank: false,
        blankText:"<?php echo s("Please, select a language.",null,true); ?>",
        store: <?php echo $llist ?>,
        forceSelection: true,
        triggerAction: 'all',
        listWidth: 150
      },{
        xtype:"combo",
        tpl: '<tpl for="."><div ext:qtip="{text}" class="x-combo-list-item">{text}</div></tpl>',
        fieldLabel:"<?php echo s("Time Zone",null,true); ?>",
        hiddenName: "timezone", 
        allowBlank: false,
        blankText:"<?php echo s("Please, select your time zone.",null,true); ?>",
        forceSelection: true,
        store: <?php echo $tzonelist ?>,
        value: <?php echo $CURRENT_USER->timezone ?>,
        triggerAction: 'all',
        listWidth: 150,
        id: "userLocaleField"
      },{
        xtype:"textfield",
        fieldLabel:"<?php echo s("New Password",null,true); ?>",
        name:"password",
        inputType:"password",
        id:"password",
        minLength: <?php echo MIN_PASSWORD_LEN; ?>
      },{
        xtype:"textfield",
        fieldLabel:"<?php echo s("Confirm New Password",null,true); ?>",
        name:"confpassword",
        inputType:"password",
        vtype: "password",
        initialPassField: "password",
	  }]
}
